home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / GetMyHelpProc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  1.2 KB  |  51 lines  |  [TEXT/KAHL]

  1. /*    GetMyHelpProc.c    */
  2.  
  3. #include "GetMyHelpProc.h"
  4. #include "TE32K.h"
  5. #include "Globals.h"
  6. #ifndef __C14__
  7. #include    "C14 Calculator.h"
  8. #endif
  9.  
  10. void    GetMyHelpSeg(void)    {}
  11.  
  12. void    GetMyHelpList( ListHandle        helpList )
  13. {
  14.     Handle            helpHandle;
  15.     short            h,v;
  16.     short            j;
  17.     
  18.     helpCell.h = 0;
  19.     helpCell.v = 0;
  20.     j=0;
  21.     LAddRow (helpCount-1, 1, helpList);
  22.     helpHandle = (Handle) -1;                    /* assign non-null for loop            */
  23.     for (j=0; j<helpCount; j++)                    /* helpCount defined in MyHeaders.h    */
  24.     {
  25.         helpHandle = GetResource ('TEXT', 1000+j);
  26.         HLock (helpHandle);
  27.         if (helpHandle)
  28.         {
  29.             if ( (SizeResource(helpHandle)) > 32)
  30.                 LSetCell (*helpHandle, 31, helpCell, helpList);
  31.             else
  32.                 LClrCell (helpCell, helpList);
  33.             helpCell.v++;
  34.         }
  35.         HUnlock (helpHandle);
  36.         ReleaseResource (helpHandle);    
  37.     }
  38.     helpHandle = GetResource('TEXT', 1000);        /* get "How to Use Help" TEXT        */
  39.     HLock (helpHandle);
  40.     helpLong = SizeResource(helpHandle);        /* get TEXT size                    */
  41.     TESetText (*helpHandle+32, helpLong-32, windTbl[1].windTEH[0]);
  42.     TECalText (windTbl[1].windTEH[0]);
  43.     helpCell.v = 0;
  44.     helpPrev = 0;
  45.     LSetSelect (TRUE, helpCell, helpList);
  46.     HUnlock (helpHandle);
  47.     ReleaseResource (helpHandle);
  48.  
  49.     InvalRect (&windTbl[1].windRec.port.portRect);        /* request redraw        */
  50.  
  51. }